package com.fjwt.gz.proxy.ctrl.activity;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.fjwt.gz.core.model.ApiRes;
import com.fjwt.gz.db.dto.ActivityTemplateDTO;
import com.fjwt.gz.db.entity.ActivityTemplateEntity;
import com.fjwt.gz.db.vo.ActivityTemplateVO;
import com.fjwt.gz.proxy.ctrl.CommonCtrl;
import com.fjwt.gz.service.impl.ActivityTemplateService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 活动模版
 *
 */
@RestController
@Slf4j
@RequestMapping("/api/activity/template")
public class ActivityTemplateController extends CommonCtrl {

    @Autowired
    private ActivityTemplateService activityTemplateService;

    /**
     * 查询活动模板列表
     * @return
     */
    @GetMapping
    public ApiRes list() {
        ActivityTemplateDTO activityTemplateDTO = getObject(ActivityTemplateDTO.class);
        IPage<ActivityTemplateVO> page = activityTemplateService.queryList(getIPage(true), activityTemplateDTO);
        return ApiRes.page(page);
    }

}
